package com.nuoniu.sibanyun.controller.production;

import com.nuoniu.sibanyun.common.result.HttpResult;
import com.nuoniu.sibanyun.entity.production.ErpBomGroup;
import com.nuoniu.sibanyun.service.production.IErpBomGroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  bom分组
 * </p>
 *
 * @author 小啊刚
 * @since 2021-01-08
 */
@RestController
@RequestMapping("/bomGroup")
@Api(value = "bom分组", tags = "bom分组")
public class ErpBomGroupController {

    @Autowired
    private IErpBomGroupService bomGroupService;

    @ApiOperation("获取bom分组列表")
    @GetMapping("getList")
    public HttpResult getList() {
        return HttpResult.ok(bomGroupService.getList());
    }

    @ApiOperation("保存")
    @PostMapping("save")
    public HttpResult save(@RequestBody ErpBomGroup bomGroup) {
        bomGroupService.saveBomGroup(bomGroup);
        return HttpResult.ok();
    }

    @ApiOperation("删除")
    @DeleteMapping("delete")
    public HttpResult delete(Long id) {
        bomGroupService.deleteById(id);
        return HttpResult.ok();
    }
}
